# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-couchdb
_pkgname=couchdb-python
pkgver=1.2
_commit=44ec56ced41d507fce4237d01ea467f7505f58e1
pkgrel=4
pkgdesc='Python library for working with CouchDB.'
url='https://github.com/djc/couchdb-python/'
license=('BSD')
arch=('any')
depends=('python2-setuptools')
source=("https://github.com/djc/couchdb-python/archive/$pkgver.tar.gz")
sha512sums=('eaa672a820b6dfd8ffcc5b8aeba43e95f90249746127c2d30907b5cea847a3e4226906dab187040a75bd4c0952ff6eefd1ec8593607eac208fc44ecf27ea77d5')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"

  for i in "$pkgdir/usr/bin/"*; do
    mv $i "${i}2"
  done
}

